<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增班级')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-room-add">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">班级名称：</label>
                    <div class="col-sm-8">
                        <input name="roomName" class="form-control" type="text" required>
                    </div>
                </div>
            </div>

            <div class="col-xs-12">
                <div id="element" class="form-group">
                    <label class="col-sm-3 control-label is-required">分校/班主任：</label>
                    <div class="col-sm-4">
                        <select class="dept form-control m-b" data-first-title="请选择">
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="col-sm-4">
                        <select class="user form-control m-b" name="userId" data-first-title="请选择">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">备注：</label>
                    <div class="col-sm-8">
                        <textarea name="remark" class="form-control"></textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: jquery-cxselect-js" />
    <script th:inline="javascript">
        var userDatas = [[${@common.getMasterSelectJson()}]];
        $('#element').cxSelect({
            selects: ['dept','user'],
            jsonValue: 'v',
            data: userDatas
        });

        var prefix = ctx + "system/room"
        $("#form-room-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-room-add').serialize());
            }
        }
    </script>
</body>
</html>